
let markId = getUrlString('markid');
let groupid = getUrlString('groupid');
let userid;
//获取用户信息
function getsetting () {
    getData('get','/niu/apiv3/member_getsetting.php',{'markid':markId},function (data) {
        console.log(data);
        userid = data.userid;
        $('#nick').html(data.nick);
        $('#faceurl').attr('src',data.faceurl);
        $('.name').click(function () {
            window.location.href = 'dancool://member='+userid;
        });
    })
}

getsetting();

function getGroupInfo () {
    getData('get','/niu/apiv3/member_jmessage_group.php?method=getGroupDetail',{'groupid':groupid},function (data) {
        console.log(data);
        $('#name').html(data.body.name)
    })
}
getGroupInfo();

//退出群聊
$('#deleteFrd').click(function (data) {
    getnative('dancool://message_exitGroup='+groupid+'')
    // getData('get','/niu/apiv3/member_jmessage_group.php?method=removeGroupMember',{'groupid':groupid,'userid':'djuser_'+userid},function (data) {
    //     console.log(data);
    //     if (data.body === null){
    //         laymsg('退出成功');
    //
    //     } else {
    //         laymsg(data.body.error.message)
    //     }
    // })
});
function getnative(actionurl) {
    var u = navigator.userAgent;
    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
    var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
    if (isiOS) {
        window.webkit.messageHandlers.getnative.postMessage(actionurl);
    }else {
        ikags.getnative(actionurl)
    }
}

function jsnativeresult(tag1,tag2,tag3) {

    if(tag1 === 'dancool://message_exitGroup='+groupid+''){
        laymsg('退出成功');
    }
}